package com.navinfo.platform.wbs.dto;

import java.util.HashMap;
import java.util.Map;

public enum OperationStatus {

    NON_OPERATION(1, "未运营状态"),
    IDLE_SPEED(2, "怠速状态"),
    AIR_IDLE_SPEED(3, "空调怠速"),
    RECREATION_IDLE_SPEED(4, "娱乐怠速"),
    PUMP_IDLE_SPEED(5, "打气怠速"),
    EXTRACTION_IDLE_SPEED(6, "取力怠速"),
    RUNNING(7, "运行状态")
    ;

    private static Map<Integer, OperationStatus> statusMap;

    static {
        statusMap = new HashMap<>();
        for(OperationStatus operationStatus : values()){
            statusMap.put(operationStatus.status, operationStatus);
        }
    }

    private int status;
    private String name;

    OperationStatus(int status, String name){
        this.status = status;
        this.name = name;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static OperationStatus getOperationStatus(int status){
        return statusMap.get(status);
    }
}